import axios from "@/request/axios"

interface UserLoginType {
  userAccount: string,
  userPassword: string
}
// 登录
export const userLogin = (parent: UserLoginType) => axios.post("/api/user/login", parent)

interface userRegisterType {
  checkPassword: string
  userAccount: string
  userPassword: string
}

// 注册
export const userRegister = (parent: userRegisterType) => axios.post("/api/user/register", parent)

// 根据id获取用户信息
export const getUserInterface = (id: number) => axios.get(`/api/user/get?id=${id}`)

// 注销账户
export const userLogout = () => axios.post("/api/user/logout")

interface getInterfaceListType {
  current: number,
  pageSize: number
}
// 获取接口列表
export const getInterfaceList = (params: getInterfaceListType) => axios.get(`/api/interfaceInfo/list/page`, {
  params
})
